package cn.ahaiahaixx.supemarketonline.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.ahaiahaixx.supemarketonline.model.TbAdminUsermodel;
import cn.ahaiahaixx.supemarketonline.service.AdminUserService;
import cn.ahaiahaixx.supemarketonline.utils.JsonMessage;

/**
 * 管理用户控制器
 * 
 * @author Aiden Pearce
 *
 */
@RestController
@RequestMapping("/adminuser")
public class AdminUserController {

  @Autowired
  private AdminUserService adminUserService;

  @RequestMapping("/login")
  public JsonMessage login(TbAdminUsermodel model) throws Exception {
    return adminUserService.login(model);
  }

  @RequestMapping("/logout")
  public JsonMessage logout(TbAdminUsermodel model) throws Exception {
    return adminUserService.logout(model);
  }

  @RequestMapping("/getUserInfo")
  public JsonMessage getUserInfo(TbAdminUsermodel model) throws Exception {
    return adminUserService.getUserInfo(model);
  }
}
